package xml;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import java.io.IOException;

/**
 * @Author wangzhipeng
 * @Date 2020-08-25 9:41 下午
 * @Description
 */
public class MyXPath {
    public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException {
        //创建工厂
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        //创建解析器
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        //通过解析器读取配置文件
        Document document = documentBuilder.parse("src/main/java/xml/student.xml");
        //创建XPathFactory对象
        XPathFactory.newInstance().newXPath();

    }
}
